home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Genie / Projects / AEA / Source / Includes / AEAModel.hh < prev    next >
Encoding:
Text File  |  2000-06-24  |  1.9 KB  |  53 lines

  1. /*    ===========
  2.  *    AEAModel.hh
  3.  *    ===========
  4.  */
  5.  
  6. #pragma once
  7.  
  8. #include <AppleEvents.h>
  9. #include <AEObjects.h>
  10.  
  11. class AEATokenModel;
  12. class AEADescAppleEvent; // only for RespondToEvent
  13. class AEADesc;
  14.  
  15. class AEAModel {
  16. public:
  17.     AEAModel() : mTransient(false) {}
  18.     virtual ~AEAModel() {}
  19.     
  20.     virtual bool IsTransient() {return mTransient;}
  21.     virtual void SetTransience(bool inTransient) {mTransient = inTransient;}
  22.     
  23.     virtual void KissGoodbye() {if (mTransient) delete this;}
  24.     
  25.     virtual void MakeToken(AEATokenModel *&outToken);
  26.     
  27.     virtual DescType Type() const {return typeObjectSpecifier;}
  28.     virtual DescType Class() const = 0;
  29.     
  30.     virtual void GetContainerObjSpec(AEDesc &outAEDesc) const = 0;
  31.     
  32.     virtual DescType PreferredKeyForm() const {return typeNull;}
  33.     virtual void GetKeyData(DescType inKeyForm, AEDesc &outAEDesc) const;
  34.     virtual void MakeObjSpecifier(AEDesc &outAEDesc) const;
  35.     virtual void MakeDescriptor(AEDesc &outAEDesc) const {MakeObjSpecifier(outAEDesc);}
  36.     
  37.     virtual long CountElements(DescType inDesiredClass) const;
  38.     virtual void GetElementByIndex(DescType inDesiredClass, long inIndex, AEAModel *&outObject) const;
  39.     //virtual void GetElementByName(DescType inDesiredClass, void *inName, long inSize, CAEOMDatum *&outObject) const;
  40.     virtual void GetElementByName(DescType inDesiredClass, const AEADesc &inName, AEAModel *&outObject) const;
  41.     virtual void GetElementByID(DescType inDesiredClass, long inID, AEAModel *&outObject) const;
  42.     virtual void GetProperty(DescType inDesiredClass, DescType inPropertyID, AEAModel *&outObject) const;
  43.     virtual AEAModel *GetProperty(DescType inDesiredClass, DescType inPropertyID) const;
  44.     
  45.     virtual void MakeElement(DescType inNewClass /*, at*/ /*, with properties*/);
  46.     
  47.     // I'm getting rid of this as soon as possible.
  48.     virtual void RespondToEvent(const AEADescAppleEvent *inAppleEvent, AEADescAppleEvent *outReply);
  49.     
  50. protected:
  51.     bool mTransient;
  52. };
  53.